/**
 * ClassName 提交审核处理
 */
Ext.define("core.oa.view.WfTaskSubmitWindow", {
			extend : "Ext.window.Window",
			alias : "widget.wfTaskSubmitWindow",
			id : "wfTaskSubmitWindow",
			width : 600,
			height : 518,
			title : "任务执行",
			layout : "border",
			closable : true,
			closeAction:"destroy",
			modal : true,
		initComponent : function() {
			//返回参数
			var resObj=this.responseObj;
			//返回参赛处理--数据id
			var idValue=this.idValue;
			//流程id
			var taskId=resObj.taskId;
			//流程图
			var html="<p>图片未找到！</p>";
			Ext.Ajax.request({
				url : APPBASE + "pc/wfTaskJobAction!taskImage.action",
				params : {
					taskId:taskId,
					taskName:resObj.TA_START,
					modelName : "com.oa.model.BorrowMoney",
					modelId : idValue,
					modelIdName:'id'
					},
				async : false,
				method : "POST",
				timeout : 4000,
				success : function(response, opts) {
					if(response.responseText && response.responseText!=""){
						 html=response.responseText;
					}
				}});
			
			//人员选择参赛
			//委托方式
			var assigneType=resObj.assigneType;
			//委托人
			var assignes=resObj.assignes;
			//委托角色
			var roles=resObj.roles;
			//委托结构
			var orgs=resObj.orgs;
			//流程定义id
			var processFunMountId=resObj.processFunMountId;
			//是否可以选择人员
			var hidden=this.hidden;
			var taskconmentsHide=this.taskconmentsHide;
			var ref = resObj.ref;
			//单选
			var multiSelect = true;
			 if (resObj.assigneType == "ASSIGNE") {
			     multiSelect = false;
			 }
			 
			 //按钮
			 var btnObj;
			 if (ref == "wfNext") {
					btnObj = {
							xtype : "button",
							ref : "wfNext",
							iconCls : "wfnext",
							text : "提交",
							assigneType :assigneType,
							assignes :assignes,
							roles :roles,
							orgs :orgs,
							taskId:taskId,
							processFunMountId:processFunMountId,
							modelName : "com.oa.model.BorrowMoney",
							idValue : idValue
					};
				} else {
					btnObj = {
						xtype : "button",
						ref : "wfBack",
						iconCls : "wfback",
						text : "回退",
						taskId: btn.taskId,
						modelName : "com.oa.model.BorrowMoney",
						idValue : idValue
					};
					hidden = true;
				}
			
			  //布局展示处理
				this.items=[{
						region : 'west',
						xtype : "roleusertree",
						width:200,
						hidden:hidden,
						multiSelect:multiSelect
					},{
						region : "center",
						xtype : "panel",
						ref:"taskjob",
						width:300,
						layout : "border",
						tbar:[btnObj],
						items : [{
							region : 'north',
							hidden:taskconmentsHide,
							xtype : "taskconments"
							},{
								region : 'center',
								xtype : "panel",
								layout:"fit",
								autoScroll:true,
								title:"流程图",
								html:html
							}
						]
					}];
				this.callParent(arguments);
			}
		});